/**
 **************************************************************************
 * @file     main.c
 * @version  v2.0.7
 * @date     2022-02-11
 * @brief    main program
 **************************************************************************
 *                       Copyright notice & Disclaimer
 *
 * The software Board Support Package (BSP) that is made available to
 * download from Artery official website is the copyrighted work of Artery.
 * Artery authorizes customers to use, copy, and distribute the BSP
 * software and its related documentation for the purpose of design and
 * development in conjunction with Artery microcontrollers. Use of the
 * software is governed by this copyright notice and the following disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
 * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
 * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
 * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
 * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
 *
 **************************************************************************
 */

#include <stdio.h>

#include "devmgr_service_start.h"
#include "los_task.h"
#include "los_memory.h"

#include "at32f403a_407.h"

#if USART2_RECV_CALLBACK 
void Usart2_on_recv(char *data, uint32_t len)
{
  printf("uart2 recv: %s  len:%d\n", data, len);
}
#endif
int main(void)
{
  system_clock_config();

  at32_board_init();
  nvic_priority_group_config(NVIC_PRIORITY_GROUP_2); //[0:4,0:4]
  uart_print_init(115200);

  if (LOS_KernelInit() == LOS_OK)
  {
    if (DeviceManagerStart())
    {
      printf("[%s] No drivers need load by hdf manager!", __func__);
    }

    if (OHOS_SystemInit() == LOS_OK)
    {
    }

    LOS_Start();
  }

  while (1)
  {
  }
}
